use std::time::{Instant, Duration};

use chrono::Utc;
use uuid::Uuid;

use crate::gen::{entities::{Account, MetaData, Name}};

/**
 * @author Dream-Lab مۇختەرجان مەخمۇت
 * @email ug-project@outlook.com
 * @create date 2022-07-23 15:59:33
 * @modify date 2022-07-23 15:59:33
 * @desc [description]
*/

impl MetaData {
    pub fn new_with_default_value() -> MetaData {
        MetaData { created_at: Utc::now().timestamp(), updated_at: Utc::now().timestamp(), uuid: Uuid::new_v4().to_string(), }
    }
}

impl Name {
    pub fn new(ug: &str, zh: &str) -> Name {
        Name { ug: ug.into(), zh: zh.into(), meta: Some(MetaData::new_with_default_value()), }
    }
}

